//
//  NSString+WMEFormatTimer.m
//  WMEMusic
//
//  Created by 恩叔 on 16/5/2.
//  Copyright © 2016年 enshu. All rights reserved.
//

#import "NSString+WMEFormatTimer.h"

@implementation NSString (WMEFormatTimer)

+ (NSString*)formatTimer:(CGFloat)timer{
    
    return  [NSString stringWithFormat:@"%02ld:%02ld",(NSInteger)timer/60,(NSInteger)timer%60];
    
}

- (CGFloat)ES_StringToTime{
    
    NSString *minute = [[self componentsSeparatedByString:@":"] firstObject];
    NSString *seconde = [[self componentsSeparatedByString:@":"] lastObject];
    
    //换算成秒
    CGFloat time = [minute floatValue] * 60 + [seconde floatValue];
    
    return time;
}

@end
